<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;  
        }
        #app{
            width: 100%;
            height: 400px;
            background: #fff;
        }
        #head{
            width: 100%;
            height: 200px;
            background: rgb(194, 189, 189);
        }
        .imgs img{
            height: 120px;
        }
        .good{
            display: flex;
            justify-content: flex-start;
        }
        .header{
            display: flex;
            justify-content: space-between;
        }
        .header span:nth-child(1){
            font-size: 18px;
            font-weight: 600;
        }
        .shop{
            height: 120px;
            width: 300px;
        }
        .shop .price div{
            display: inline-block;
            margin-top: 60px;
        }
        .shop .price div:nth-child(1){
            color: yellowgreen;
        }
        .shop .price div:nth-child(2){
            margin-left: 120px;
        }
        .shop .price div span{
            display: inline-block;
            width: 14px;
            height: 14px;
            text-align: center;
            line-height: 14px;
            background-color: lightskyblue;
            color: white;
            border-radius: 50%;
        }
        .shop .price div span:nth-child(2){
            color: black;
            background-color: #fff;
        }
        .foot{
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #555;
            color: white;
            left: 0;
            position: fixed;
            bottom: 0;
            width: 100%;
            padding: 20px;
            box-sizing: border-box;
        }
        .foot span:nth-child(2){
            background-color: lightgreen;
            color: white;
            padding: 5px 15px;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <div id="head"></div>
    <div id="app">
        <div class="dity">
            <div class="header">
                <span>已选商品</span>
                <span @click="clean">清空</span>
            </div>
            <div v-if="list.length != 0" class="list">
                <div v-for="(item,index) in list" :key="index " class="good">
                    <div class="imgs">
                        <img :src="item.pic" alt="">
                    </div>
                    <div class="shop">
                        <div class="name">{{ item.name }}</div>
                        <div class="price">
                            <div>￥{{item.price}}</div>
                            <div>
                                <span @click="sub(item)">-</span>
                                <span>{{item.count}}</span>
                                <span @click="add(item)">+</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="foot">
            <span>总数：{{totalCount}} 总价：{{totalPrice}} </span>
            <span>去结算</span>
        </div>
    </div>
    <script src="./vue-2.5.21.js"></script>
    <script src="./作业1.js"></script>
</body>
</html>